package com.atguigu.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 2 * @Author: madonghui
 * 3 * @Date: 2020/11/4 15:31
 * 4
 */
@RefreshScope //解决的问题，config远程仓库发生了改变，config能实时的更新信息，而client没有的刀最新的数据只能重启服务
@RestController
@RequestMapping("/config")
public class ConfigController3366 {

    @Value("${config.info}")
    private String configInfo;

    @GetMapping("/configInfo")
    public String getConfigInfo(){
        return configInfo;
    }
}
